#include "rBuffer.h"


rBuffer::rBuffer(void):
	pID(-1),
	pStreamId(-1),
	pStreamPosition(0),
	pX(0),
	pY(0),
	pW(0),
	pH(0),
	pChilds()
{
}

rBuffer::rBuffer(const rBuffer & from)
{
	(*this) = from;
}

rBuffer::~rBuffer(void)
{
}

void rBuffer::operator=(const rBuffer & from)
{
	rBuffer();
	pID = from.pID;
	pStreamId = from.pStreamId;

	pStreamPosition = from.pStreamPosition;
	
	pX = from.pX;
	pY = from.pY;
	pW = from.pW;
	pH = from.pH;

	for (std::vector<rBuffer*>::iterator	i =const_cast<std::vector<rBuffer*> *>(&(from.pChilds) )->begin();
											i!=from.pChilds.end();
											i++)
	{
		pChilds.push_back((*i));
	}
}


id_type rBuffer::getId() const
{
	return pID;
}

void rBuffer::setId(id_type type)
{
	pID = type;
}

id_type rBuffer::getStreamId() const
{
	return pStreamId;
}

void rBuffer::setStreamId(id_type type)
{
	pStreamId = type;
}

void rBuffer::MoveTo(unsigned int x, unsigned int y)
{
	pX = x;
	pY = y;
}
void rBuffer::Resize(unsigned int w, unsigned int h)
{
	pW = w;
	pH = h;
}

id_type rBuffer::getX() const
{
	return pX;
}
id_type rBuffer::getY() const
{
	return pY;
}
id_type rBuffer::getW() const
{
	return pW;
}
id_type rBuffer::getH() const
{
	return pH;
}

unsigned int rBuffer::getStreamPosition() const
{
	return pStreamPosition;
}
void rBuffer::setStreamPosition(unsigned int pos)
{
	pStreamPosition = pos;
}